// Problem: F. Lisa and the Martians
// Contest: Codeforces - Codeforces Round 888 (Div. 3)
// URL: https://codeforces.com/contest/1851/problem/F
// Memory Limit: 512 MB
// Time Limit: 3000 ms
// Date: 2023-07-26 08:52:12
//
// Powered by CP Editor (https://cpeditor.org)
#include <algorithm>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <bitset>
#include <string>
#include <stack>
#include <deque>
#include <queue>
#include <cmath>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
using i64 = long long;
void solve() {
int n, k;
cin >> n >> k;
vector<int> a(n);
for (int i = 0; i < n; i ++ ) {
cin >> a[i];
}
vector<int> p(n);
iota(p.begin(), p.end(), 0);
sort(p.begin(), p.end(), [&](int i, int j) {
return a[i] < a[j];
});
int s = (1 << k) - 1, cur = 0;
for (int i = 1; i < n - 1; i ++ ) {
if ((s ^ (a[p[i]] ^ a[p[i + 1]])) > (s ^ (a[p[cur]] ^ a[p[cur + 1]]))) {
cur = i;
}
}
s = s ^ a[p[cur + 1]];
cout << p[cur] + 1 << ' ' << p[cur + 1] + 1 << ' ' << s << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
while (tt -- ) {
solve();
}
return 0;
}
647. Palindromic Substrings | 583. Delete Operation for Two Strings |
518. Coin Change 2 | 516. Longest Palindromic Subsequence |
468. Validate IP Address | 450. Delete Node in a BST |
445. Add Two Numbers II | 442. Find All Duplicates in an Array |
437. Path Sum III | 436. Find Right Interval |
435. Non-overlapping Intervals | 406. Queue Reconstruction by Height |
380. Insert Delete GetRandom O(1) | 332. Reconstruct Itinerary |
368. Largest Divisible Subset | 377. Combination Sum IV |
322. Coin Change | 307. Range Sum Query - Mutable |
287. Find the Duplicate Number | 279. Perfect Squares |
275. H-Index II | 274. H-Index |
260. Single Number III | 240. Search a 2D Matrix II |
238. Product of Array Except Self | 229. Majority Element II |
222. Count Complete Tree Nodes | 215. Kth Largest Element in an Array |
198. House Robber | 153. Find Minimum in Rotated Sorted Array |